import { ref } from "vue";

export function closeMain() {
  window.ipcRenderer.send("mainWindow:close");
}

export function setTaskTimer(time, name) {
  window.ipcRenderer.send("setTaskTimer", time, encodeURIComponent(name));
}

export function closeRemind() {
  window.ipcRenderer.send("remindWindow:close");
}

export function setRemindMsg() {
  const remindMsg = ref("");
  window.ipcRenderer.on("setTask", (event, task) => {
    remindMsg.value = decodeURIComponent(task);
  });
  return remindMsg;
}
